﻿<?xml version="1.0" encoding="utf-8" ?>
<xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.codeplex.com/MSSqlSchemaDoc"
  xmlns="http://www.codeplex.com/MSSqlSchemaDoc"
  attributeFormDefault="unqualified"
  elementFormDefault="qualified">

  <xs:complexType name="ForeignKeyCollectionType">
    <xs:sequence>
      <xs:element name="ForeignKey" maxOccurs="unbounded" minOccurs="0">
        <xs:complexType>
          <xs:sequence>

            <xs:element name="IsDisabled" type="xs:boolean" />
            <xs:element name="IsNotForReplication" type="xs:boolean" />
            <xs:element name="IsNotTrusted" type="xs:boolean" />
            <xs:element name="DeleteReferentialActionDescription" type="xs:string" />
            <xs:element name="UpdateReferentialActionDescription" type="xs:string" />
            <xs:element name="IsSystemNamed" type="xs:boolean" />
            
            <xs:element name="Columns">
              <xs:complexType>
                <xs:sequence>
                  
                  <xs:element name="ForeignKeyColumnPair" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:attribute name="ReferencingColumnName" type="xs:string" />
                      <xs:attribute name="ReferencedColumnName" type="xs:string" />
                      <xs:attribute name="ReferencedTableName" type="xs:string" />
                    </xs:complexType>
                  </xs:element>
                  
                </xs:sequence>
              </xs:complexType>
            </xs:element>

          </xs:sequence>
          <xs:attribute name="Name" type="xs:string" />
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

</xs:schema>